//
//  UIAlertController+Alert.h
//  MGPublic
//
//  Created by lhongl on 2025/10/15.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIAlertController (Alert)

/// 设置标题
- (UIAlertController *(^)(NSMutableAttributedString *title))attrTitle;

/// 设置内容
- (UIAlertController *(^)(NSMutableAttributedString *message))attrMessage;

/// 添加默认Action
/// - Parameters:
///   - titile: 标题
///   - handler: 事件
- (void)addActionWithDefault:(NSString *)title
                 handler:(void (^ __nullable)(UIAlertAction *action))handler;

/// 添加多个Action
/// - Parameters:
///   - titles: 标题
///   - handler: 回调
- (void)addActionsWithTitles:(NSArray <NSString *> *)titles
                      handler:(void (^ __nullable)(UIAlertAction *action,NSInteger index))handler;

/// 添加Destructive的Action
/// - Parameters:
///   - titile: 标题
///   - handler: 事件
- (void)addActionWithDestructive:(NSString *)title
                 handler:(void (^ __nullable)(UIAlertAction *action))handler;

/// 添加默认Action
/// - Parameters:
///   - titile: 标题
///   - color: 颜色
///   - handler: 事件
- (void)addActionWithTitle:(NSString *)title
                     color:(UIColor *)color
                   handler:(void (^ __nullable)(UIAlertAction *action))handler;

/// 添加多个Action
/// - Parameters:
///   - titles: 标题
///   - color: 颜色
///   - handler: 回调
- (void)addActionWithTitles:(NSArray <NSString *> *)titles
                     color:(UIColor *)color
                   handler:(void (^ __nullable)(UIAlertAction *action,NSInteger index))handler;

/// 添加取消的Action
/// - Parameters:
///   - titile: 标题
///   - handler: 事件
- (void)addActionWithCancel:(NSString *)title
                 handler:(void (^ __nullable)(UIAlertAction *action))handler;

/// 添加取消的Action
/// - Parameters:
///   - titile: 标题
///   - color: 颜色
///   - handler: 事件
- (void)addActionWithCancel:(NSString *)title
                      color:(UIColor *)color
                 handler:(void (^ __nullable)(UIAlertAction *action))handler;

/// 添加取消的Action
/// - Parameters:
///   - titile: 标题
- (void)addActionWithCancel:(NSString *)title;



/// 显示Alert
- (void)showAlert;

@end

NS_ASSUME_NONNULL_END
